<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<!--{include file='comm/header.tpl'}-->
	<title>日志管理</title>
	<link rel="stylesheet" type="text/css" href="/framework/JSCal2/src/css/jscal2.css" />
	<link rel="stylesheet" type="text/css" href="/framework/JSCal2/src/css/border-radius.css" />
	<link rel="stylesheet" type="text/css" href="/framework/JSCal2/src/css/steel/steel.css" />
	
</head>
<script language="JavaScript" src="/quanliadmin/docroot/js/commonCheck.js" type="text/javascript"></script>
<script src="/framework/JSCal2/src/js/jscal2.js"></script>
<script src="/framework/JSCal2/src/js/lang/cn.js"></script>
<!--{php}-->
	global $xajax;
	$xajax->printJavascript( "/framework/xajax" );
<!--{/php}-->
<body>
	<div style="width:100%">
	<!--{include file='comm/menu.tpl'}-->
		<div id='body_content'>
			<form id="search_customer" name="search_customer" action="/quanliadmin/app/project/errorLog.pscript?operFlg=2" onsubmit="return false" method="POST">
				<table style="width:960px;margin:0px auto;"  border="0" class="comm_header_table">
					<tr> 
						<td style="height:50px;text-align:center;" colspan="7"><h1>日志管理</h1></td>
					</tr>
					<tr style="height:25px;">
						<td style="text-align:right;width:10%">
							查询时间：
							<input type='text' id='startDate' value="<!--{$startDate}-->" name='startDate' size="10" readonly >
							<input class="selectClearTimeBtn" id="startDateBtn" name="startDateBtn" type="button" value="选择">
							～
							<input id='endDate' name='endDate' value="<!--{$endDate}-->" type='text'  size="10" readonly >
							<input class="selectClearTimeBtn" id="endDateBtn" name="endDateBtn" type="button" value="选择" style="margin-right:10px;">
						</td>
						
						<td style="text-align:right;width:12%">
							处理结果：
						</td>
						<td style="text-align:left;width:20%">
							<select name="handleResult" id="handleResult">
								<!--{if $handleResult == 1}-->
									<option value="1" selected>已处理</option>
									<option value="0">未处理</option>
								<!--{else}-->
									<option value="1">已处理</option>
									<option value="0" selected>未处理</option>
								<!--{/if}-->
							</select>
							
						</td>
						<td style="width:12%;">
							<input type="button" class="searchBtn searched" name="searchBut" onclick="searchBtn();" id="searchBut" value="查询">
							<input type="button" class="searchBtn imported" name="searchBut" onclick="errorImport();"id="searchBut" value="导入">
							<input type="button" class="searchBtn exported" name="searchBut" onclick="errorExport();"id="searchBut" value="导出">
						</td>
					</tr>
				</table>
			</form>
			
			<form method="POST" id="searchForm">
				<table class="comm_table" style="width:100%;margin:0px auto;">
					<tr>
						<th style="width:5%">错误等级</th>
						<th style="width:10%">错误时间</th>
						<th style="width:40%">错误信息</th>
						<th style="width:35%">错误文件</th>
						<th style="width:5%">错误行</th>
						<th style="width:5">处理结果</th>
						
					</tr>
			<!--{if $operFlg==1}-->
				</table>
			</form>
			<!--{else}-->
				<!--{if $listCount == 0}-->
				<tr>
					<td colspan="6" style="text-align:center">
						<li style="text-align:center; color:red; font-size:14px;">查询到0条记录</li>
					</td>
				</tr>
				<!--{else}-->
				<!--{foreach from=$error_info item=res}-->
				<!--{if $res->errorLevel == "warning"}-->
					<tr>
					<td style="color:red">警告</td>
					<td style="color:red"><!--{$res->occurTime}--></td>
					<td style="color:red"><!--{$res->errorMessage|truncate:80:"....."}--></td>
					<td style="color:red"><!--{$res->errorFile}--></td>
					<td style="color:red"><!--{$res->errorLine}--></td>
					<!--{if $res->handleResult == 0}-->
					<td class="td_wrap" style="text-align:center;"  >
					<div class="relative" style="float:left;">
					&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delete_pop_right(this,'您确认处理该错误信息吗?');" style="color:red">未处理</a>
					<div class="absolute_right hide">
						<p></p>
						<a onclick="doError('<!--{$res->uuid}-->');" href="javascript:void(0);">确认</a>
						<a onclick="cancal_delete_pop_right();" href="javascript:void(0);">取消</a>
					</div>
					</div>
					
					</td>
					<!--{else}-->
					<td style="color:red">&nbsp;&nbsp;已处理</td>
					<!--{/if}-->
				</tr>
				<!--{elseif $res->errorLevel == 'notice'}-->
				<tr>
					<td>注意</td>
					<td><!--{$res->occurTime}--></td>
					<td><!--{$res->errorMessage|truncate:80:"....."}--></td>
					<td><!--{$res->errorFile}--></td>
					<td><!--{$res->errorLine}--></td>
					<!--{if $res->handleResult == 0}-->
					<td class="td_wrap" style="text-align:center;"  >
					<div class="relative" style="float:left;">
					&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delete_pop_right(this,'您确认处理该错误信息吗?');">未处理</a>
					<div class="absolute_right hide">
						<p></p>
						<a onclick="doError('<!--{$res->uuid}-->');" href="javascript:void(0);">确认</a>
						<a onclick="cancal_delete_pop_right();" href="javascript:void(0);">取消</a>
					</div>
					</div>
					
					</td>
					<!--{else}-->
					<td>&nbsp;&nbsp;已处理</td>
					<!--{/if}-->
				</tr>
				<!--{else}-->
					<tr>
					<td style="color:red;background:#cccccc">错误</td>
					<td style="color:red;background:#cccccc"><!--{$res->occurTime}--></td>
					<td style="color:red;background:#cccccc"><!--{$res->errorMessage|truncate:80:"....."}--></td>
					<td style="color:red;background:#cccccc"><!--{$res->errorFile}--></td>
					<td style="color:red;background:#cccccc"><!--{$res->errorLine}--></td>
					<!--{if $res->handleResult == 0}-->
					<td class="td_wrap" style="text-align:center;background:#cccccc" >
					<div class="relative" style="float:left;">
					&nbsp;&nbsp;<a href="javascript:void(0);" onclick="delete_pop_right(this,'您确认处理该错误信息吗?');"  style="color:red;">未处理</a>
					<div class="absolute_right hide">
						<p></p>
						<a onclick="doError('<!--{$res->uuid}-->');" href="javascript:void(0);">确认</a>
						<a onclick="cancal_delete_pop_right();" href="javascript:void(0);">取消</a>
					</div>
					</div>
					
					</td>
					<!--{else}-->
					<td style="color:red;background:#cccccc">&nbsp;&nbsp;已处理</td>
					<!--{/if}-->
				</tr>
				<!--{/if}-->

				<!--{/foreach}-->
				<!--{/if}-->	
			
			</table>
			<!--{$footHtml}-->
			</form>
			
			<!--{/if}-->
		</div>
		<!--{include file='comm/footer.tpl'}-->
	</div>
<script>
//分页函数
//pageIndex页数
function doSearch(pageIndex) {
	var link = "/quanliadmin/app/project/errorLog.pscript?operFlg=2&pageIndex=" + pageIndex;
	$("#search_customer").attr("action",link);
	document.search_customer.submit();
	//self.location = "/quanliadmin/app/project/errorLog.pscript?operFlg=2&pageIndex=" + pageIndex;
}

//分页跳转查询
function doJumpAction() {
	
	var jumpPageIndex = document.getElementById('jumpPageIndex').value;
	if(!digitalCheck(jumpPageIndex) || jumpPageIndex.length == 0) {
		comm_alert('转跳页数必须为数字',0);
		return;
	}
	doSearch(jumpPageIndex);
}

//错误信息导出函数
function errorExport(){
	var linkExport = '/quanliadmin/app/project/errorLog.pscript?operFlg=3';
	$("#search_customer").attr("action",linkExport);
	document.search_customer.submit();
}

//错误信息导入函数
function errorImport(){
	var linkImport = '/quanliadmin/app/project/errorLog.pscript?operFlg=4';
	$("#search_customer").attr("action",linkImport);
	document.search_customer.submit();
}

//信息是否已处理函数
function doError(uuid){
	if(uuid==''){
		common_alert('参数不正确！');
	}
	xajax_doError(uuid);
}


</script>
<script type="text/javascript">
			var cal = Calendar.setup({
	          onSelect: function(cal) { cal.hide() }
	      });
	      cal.manageFields("startDateBtn", "startDate", "%Y-%m-%d");
	      cal.manageFields("endDateBtn", "endDate", "%Y-%m-%d");
</script>
<script>
function searchBtn(){
	if($("#search_customer").attr("action")=='/quanliadmin/app/project/errorLog.pscript?operFlg=3' || $("#search_customer").attr("action")=='/quanliadmin/app/project/errorLog.pscript?operFlg=4'){
		$("#search_customer").attr('action','/quanliadmin/app/project/errorLog.pscript?operFlg=2')
	}
	document.search_customer.submit();
}
</script>
<script>
$().ready(function(){
	
	//初始化日期
	var startDate = "<!--{$startDate}-->";
	if(startDate == ""){
		$("#startDate").val(currentDate());
		$("#endDate").val(currentLastDay());
	}
})
</script>
</body>
</html>